<div id="order">
    <div class="nav">
        <a href="javascript:void 0;"><div event-click="{{'$Event.bus.achs.changeType'}}" class="nav-li {{TypeNum==3&&'focus'}}" data='3'>所有订单</div></a>
        <a href="javascript:void 0;"><div event-click="{{'$Event.bus.achs.changeType'}}" class="nav-li {{TypeNum==1&&'focus'}}" data='1'>等待付款</div></a>
        <a href="javascript:void 0;"><div event-click="{{'$Event.bus.achs.changeType'}}" class="nav-li {{TypeNum==2&&'focus'}}" data='2'>等待发货</div></a>
        <!-- <a href="#admin/statistical"><div event-click="{{'$Event.bus.achs.changeType'}}" class="nav-li" data='4'>交易统计</div></a> -->
    </div>
    <hr />
    <!-- <div class="titleindex">当前位置：
        <span>{{$Cache.bus.achs.type}}</span>
    </div> -->

    <div class="orders">
        <div class="search">
            <div class="icon-search" style="width:5%;display:inline-block;"></div>
            <div style="width:90%;display:inline-block;">
                <android:input label="搜索订单" description="只需输入订单号的一部分即可搜索，多订单的同时搜索请用“,”分割搜索的关键字" value="{{$Cache.bus.achs.ach_key}}" bind-input="{{'$Cache.bus.achs.ach_key'}}" event-input="{{'$Event.bus.achs.search'}}"></android:input>
            </div>
        </div>
        {{#if $Cache.bus.achs.is_searching&&!$Cache.bus.achs.is_searchend}}
            <h3 style="color:#333">搜索中，请稍后……</h3>
        {{/if}}
        {{#if $Cache.bus.achs.is_searchend&&!bus.achs_detail.length}}
            <h3 style="color:#666">无相关的搜索结果。</h3>
        {{/if}}
        {{#each bus.achs_detail}}
        {{#> "ach_bus"}}
        {{/each}}
    </div>

    {{#if !$Cache.bus.achs.is_searching}}
        <pagination id="turn-page" page-info="$Cache.bus.achs.page_info"></pagination>
    {{/if}}
</div>

<xmp type="template" name="ach_bus">
    <div class="order-box">
        <!-- {{#if __is_cancel}} -->
        <div class="title" style="
        {{#if __is_cancel}}
            background-color:#FF5656;color:#FFF;
        {{#else}}
            {{__is_new?'background-color:#39762F;color:#FFF;':''}}
        {{/if}}">
        {{#if __is_cancel}}
            <h5>订单已经被取消！</h5>
        {{/if}}
        订单号：{{_id}}， 用户：{{info.user.info.name}}
        {{info.recommender?"（推荐者："+info.recommender.info.name+"）":""}} 
        </div>
<!--         {{#else}}
            {{#if __is_new}}
            <div class="title" style="background-color:#39762F;color:#FFF;"><h5>新的订单！</h5>订单号：{{_id}}（用户：{{info.user.info.name}}） {{info.recommender?"推荐者："+info.recommender.info.name:""}} </div>
            {{#else}}
            <div class="title">订单号：{{_id}}（用户：{{info.user.info.name}}） {{info.recommender?"推荐者："+info.recommender.info.name:""}} </div>
            {{/if}}
        {{/if}} -->
        <div class="detail">
            <div class="goods">
                {{#each info.goods_info}}
                <div class="goods-item">
                    <!-- w:100px h:100px -->
                    <div class="goods-image">
                        <a style="color:#1ba1e2;" href="http://i-zhubao.com/goods_details.html?id={{goods._id}}" target="_blank"><img bind-src="{{goods.preview_img_url}}?imageView/1/w/36/h/36"></a>
                    </div>
                    <div class="goods-info-item">
                        <a style="color:#1ba1e2;" href="http://i-zhubao.com/goods_details.html?id={{goods._id}}" target="_blank">{{goods.goods_name}}</a>（X {{num}}）</div>
                </div>
                {{/each}}
            </div>
            <div class="price">
                <div class="price-item first">总花费额：{{#Fixed cash}}</div>
                <div class="price-item" title="{{#Time create_time,'L'}}"><b>下单时间：</b>{{#Time create_time,'YYYY-MM-DD HH:mm:ss'}}</div>
            </div>
            {{#if !__is_cancel}}
                {{#> "bus_ach_controller"}}
            {{/if}}
        </div>

        <div class="addr">
        {{#if info.use_space}}
            {{#Space info.space.type}}：{{info.space.name}}
        {{#else}}
            {{#if info.user_address.name}}
                {{info.user_address.name}},{{#if info.user_address.mobilenumber}} {{info.user_address.mobilenumber}} {{info.user_address.phonenumber&&"/"+info.user_address.phonenumber}} {{#else}} {{info.user_address.phonenumber}} {{/if}}, {{info.user_address.town}},{{info.user_address.county}}，{{info.user_address.detail}}
            {{#else}}
                用户没有填写收货地址
            {{/if}}
        {{/if}}
            <div class="bottom-tools-bar">
                {{#if info.print_data}}
                <a href="{{info.print_data}}" download="订单:{{_id}}-{{$Top.bus_loginer.info.title}}.png" style="color:blue;">下载订单信息</a>
                {{#else}}
                    {{#if $CPrivate.loding_print}}
                    <span class="tool-button"><i class="icon-spinner2"></i></span>
                    {{#else}}
                    <span class="tool-button" event-click="{{'$Top.$Event.bus.achs.print'}}">
                        <android:icon type="maps-local-print-shop"></android:icon>
                    </span>
                    {{/if}}
                {{/if}}
                <span class="tool-button" event-click="{{'$Top.$Event.bus.achs.hidden_ach'}}">
                    <android:icon type="action-delete"></android:icon>
                </span>
            </div>
        </div>
    </div>
</xmp>
<style>
    .bottom-tools-bar{
        float:right;
    }
    .bottom-tools-bar .tool-button{
        cursor: pointer;
        display: inline-block;
    }
</style>